<form class="form-inline" id="scene_list_form">
	<div class="form-group">
		<div class="input-group">
			<div class="input-group-addon">开始时间</div>
			<input type="text" class="form-control" name="startTime" id="start_time" />
			<div class="input-group-addon">-结束时间</div>
			<input type="text" class="form-control" name="endTime" id="end_time" />
		</div>
	</div>
	<div class="form-group">
		<div class="input-group">
			<div class="input-group-addon">PV范围</div>
			<input type="text" class="form-control" name="minPv" id="min_pv" />
			<div class="input-group-addon">-</div>
			<input type="text" class="form-control" name="maxPv" id="max_pv" />
		</div>
	</div>
	<br/>
	<button type="button" class="btn btn-primary" onclick="query_scene_list('#scene_list_grid', '/m/ie/scene/list.json')" >查询</button>
</form>
<table id="scene_list_grid" data-toggle="table" data-toolbar="#scene_list_form" data-unique-id="sceneId" data-query-params="scene_query_params" data-click-to-select="true" data-page-size="20">
	<thead>
	    <tr>
	    	<th data-field="sceneId">ID</th>
	    	<th data-field="sceneName">场景名称</th>
	    	<th data-field="sceneLink"  data-formatter="url_formatter">场景链接</th>
	    	<th data-field="sceneCreateTime">创建时间</th>
	    	<th data-field="scenePublishTime">发布时间</th>
	    	<th data-field="pv">访问量</th>
	    	<th data-field="sceneTemplateId">样例ID</th>
	    	<th data-field="sceneTemplateName">样例名称</th>
	    	<th data-field="sceneTemplatePrice">样例价格</th>
	    	<th data-field="userPhone">用户手机号</th>
	    	<th data-field="userType" data-formatter="user_type_formatter">用户类型</th>
	    	
	    </tr>
    </thead>
</table>

<script type="text/javascript">
	$(document).ready(function() {
		///日期控件
		$('#start_time,#end_time').datetimepicker();
		//订单类型下拉框
	});
//查询
    function query_scene_list(id, url) {
        $(id).bootstrapTable('refresh', {url: url});
    }  
     function scene_query_params(params) {
        $('#scene_list_form :input').each(function() {
            if($(this).attr('name')) {
                params[$(this).attr('name')] = $(this).val();
            }
        });
        return params;
    }
    function log_formatter_time(value) {
       return new Date(value).format('yyyy-MM-dd hh:mm:ss');
    }
    function user_type_formatter(value) {
    	if(value==1) return "普通账号";
    	if(value==2) return "企业账号";
    	if(value==3) return "高级账户";
    	if(value==4) return "服务账号";
    	if(value==21) return "企业子账号";
    	if(value==99) return "运维账号";
    	return value;
    }
     function url_formatter(value) {
       return '<a target="_blank" href="' + value + '">' + value + '</a>';
    }
    
</script>